import Vue from 'vue'
import VueRouter from 'vue-router'
import App from '../App.vue'
import order from '../components/order/order'
import outStorage from '../components/outStorage/outStorage'
import dataAnalysis from '../components/dataAnalysis/dataAnalysis2'
import inventory from '../components/inventory/inventory'
import calculateWages from '../components/storeManage/calculateWages'
import expendDetail from '../components/storeManage/expendDetail'
import dataAnlysis from '../components/dataAnalysis/DataAnlysis'
// const order = r => require.ensure([], () => r(require('../components/order/order')), 'order');
// const outStorage = r => require.ensure([], () => r(require('../components/outStorage/outStorage')), 'order');
// const dataAnalysis = r => require.ensure([], () => r(require('../components/dataAnalysis/dataAnalysis')), 'dataAnalysis');

Vue.use(VueRouter);

const routes = [
    {
        path: '/',
        component: App,
        name:"home"
    },
    {
        path: '/data',
        component: dataAnlysis,
        name:"dataAnlysis"
    },
    {
        path: '/order',
        component: order,
        name:"order"
    },
    {
        path: '/outStorage',
        component: outStorage,
        name: 'outStorage',
    },
    {
        path: '/dataAnalysis',
        component: dataAnalysis,
        name: 'dataAnalysis',
    },
    {
        path: '/inventory',
        component: inventory,
        name: 'inventory',
    },
    {
        path: '/calculateWages',
        component: calculateWages,
        name: 'calculateWages',
    },
    {
        path: '/expendDetail',
        component: expendDetail,
        name: 'expendDetail',
    }

]

const router = new VueRouter({
    // mode: 'history', // 去掉首页的#哈希
    linkActiveClass: 'active',
    routes
});

export default router
